# # -*- coding:utf-8 -*-
# # author:zhou date:2019/5/10
# import sys
# import os
# import django
#
# sys.path.append("..")
# sys.path.append("../utils")
# os.environ.update({"DJANGO_SETTINGS_MODULE": "server.settings"})
# django.setup()
# from django.test import Client
#
# client = Client()
# headers = {'Content-Type': 'application/xml'}
#
# baseUrl = u"http://127.0.0.1:8000/api/develop/"
#
#
# def uploadSoft():
#     request = {
#         'token': '83764f261b574c03be2b',
#         'softwareName': "google",
#         'softwareDetails': "2020测试使用",
#         'cost': "1221212",
#         'version': "1.0",
#         'store': 1,
#         'warZone': 1,  # ForeignKey
#         'company': 1,  # ForeignKey
#         'softwareType': 1,  # ForeignKey
#         'logo': 1,  # address
#         'cover': 1,  # address
#         'verification': 1,  # address
#         'software': 1,  # address
#         'material': 1,  # address
#     }
#     res = client.post(baseUrl + 'soft/upload/', request, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
#     print(res.content)
#
#
# def uploadfiles():
#     request = {
#         'token': '83764f261b574c03be2b',
#         'files': 'E:\\softwareOnline2\\1.txt',  # address
#     }
#     res = client.post(baseUrl + 'soft/uploadFiles/', request, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
#     print(res.content)
#
#
# def updateSoft():
#     request = {
#         'token': '83764f261b574c03be2b',
#         'updateDetails': "2020测试使用",
#         'version': "4.0",
#         'softwareId': 9,  # address
#         'soft': 1,  # address
#     }
#     res = client.post(baseUrl + 'soft/update/', request, HTTP_X_REQUESTED_WITH='XMLHttpRequest')
#     print(res.content)
#
#
# if __name__ == '__main__':
#     # uploadSoft()
#     # uploadfiles()
#     updateSoft()
